Copy

Syntax: @Copy variable, start, length, variable

Copy enables strings or parts of strings to be copied between attributes and string variables. Start specifies the character start position (with 1 being the first position) and length specifies the number of characters to be copied. Start and length could be literal numeric values, as shown in the example below, or numeric attributes, variables or arrays.

Example

@Copy Grade, 3, 4, Temp

if the attribute Grade = 'Director' then this Copy command would put 'rect' into the variable Temp.

See also the Concat command - which can be used to combine strings together.

When you wish to manipulate date attributes - for example extract the month part of a date - you can use the @Assign command to assign the date to a string, and then use the Copy command on the string. An example of how to calculate a person's current age from the system date is available - see Calculate current Date of Birth.

Programmers more used to languages such as C might be looking under 'Copy' for an XpertRule command that can assign data to variables. Note that XpertRule has a simple yet more powerful @Assign command to do this.